PATH 
Mac OS 8 and 9 Developer Documentation > Text and Other International Services > Apple Type Services for Unicode Imaging (ATSUI) > Apple Type Services for Unicode Imaging Reference

     

ATSUGetIndFontName

Obtains, for an indexed font name, the font name and information about the name like type, platform, script ID, and language.

OSStatus ATSUGetIndFontName (
                     ATSUFontID iFontID,
                     ItemCount iFontNameIndex,
                     ByteCount iMaximumNameLength,
                     Ptr oName,
                     ByteCount *oActualNameLength,
                     FontNameCode *oFontNameCode,
                     FontPlatformCode *oFontNamePlatform,
                     FontScriptCode *oFontNameScript,
                     FontLanguageCode *oFontNameLanguage);
iFontID
A value of type ATSUFontID. Pass the ID of the font whose indexed font name you want information about.

iFontNameIndex
A 0-based index. Pass a value between 0 and one less than the count passed back by the function ATSUCountFontNames.

iMaximumNameLength
The maximum length of the font name. Typically, this is equivalent to the size of the buffer allocated to contain the font name pointed to by the oName parameter. To determine this length, see the discussion below.

oName
A pointer to a buffer. Before calling ATSUGetIndFontName, pass a pointer to memory that you have allocated for this buffer. If you are uncertain of how much memory to allocate, see the discussion below. On return, the buffer contains the font name string. If the buffer you allocate is not large enough, ATSUGetIndFontName passes back a partial string. You cannot pass NULL for this parameter.

oActualNameLength
A pointer to a count. On return, the actual length of the font name string. This may be greater than the value passed in the iMaximumNameLength parameter. You should check this value to make sure that you allocated enough memory for the buffer. You cannot pass NULL for this parameter.

oFontNameCode
A pointer to a value of type FontNameCode. On return, the type of the font name string. See Font Name Code Constants for a description of possible values.

oFontNamePlatform
A pointer to a value of type FontPlatformCode. On return, the encoding of the font name string. See Font Name Platform Constants for a description of possible values.

oFontNameScript
A pointer to a value of type FontScriptCode. On return, the script ID of the font name string. Depending upon the font name platform, see Macintosh Platform Script Code Constants, Microsoft Platform Script Code Constants, or Unicode Platform Script Code Constants for a description of possible values.

oFontNameLanguage
A pointer to a value of type FontLanguageCode. On return, the language of the font name string. See Font Name Language Constants for a description of possible values.

function result
A result code. The result code kATSUInvalidFontErr indicates that the ID does not correspond to any installed font. For a list of other ATSUI-specific result codes, see Result Codes.
DISCUSSION
You should call the ATSUGetIndFontName to iterate through the entries of a font name table. If you want to find the index and name of the first font in a name table with a particular font name code, language, platform, and script, call the function ATSUFindFontFromName. If you want to find the ID of the first font in a font name table with a particular font name code, language, platform, and script, call the function ATSUFindFontName.

The best way to use ATSUGetIndFontName is to call it twice:

  1. Pass the ID of the font whose name table you want to iterate in the iFontID parameter, NULL for the oName parameter, and 0 for the other parameters. ATSUGetIndFontName returns the length of the font name string in the oActualNameLength parameter.

  2. Allocate enough space for a font name buffer of the returned size, then call the function again, passing a pointer in the oName parameter; on return, the pointer references the font name string.
SPECIAL CONSIDERATIONS
ATSUGetIndFontName may allocate memory in your application heap, unless you designate a different heap by calling the function ATSUCreateMemorySetting.

VERSION NOTES
Available beginning with ATSUI 1.0.

© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)